package com.baoteng.rbspy.util;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;

/**
 * 自定义java.util.Date 日期转换器
 * @author Sunny
 *
 */
public class DateConverter implements Converter<String, Date> {
	
	@Override
	public Date convert(String source) {
		if (StringUtils.isBlank(source)) {
			return null;
		}
        String value = source.trim();
        return DateUtil.fromString(value);
		
	}
}